package HUZ_FileIO;

import java.io.*;
import java.util.Arrays;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class demo5 {
    public static void main(String[] args) throws IOException {
        File file=new File("E:\\Java网络通信程序\\TestDemo1\\file.txt");
        //使用字符流
        Reader reader=new FileReader(file);
//        int  b=0;
//        while(b!=-1){
//            b= reader.read();
//            System.out.println(b);
//        }
//        Character[]arr=new Character[30];
        char []arr2=new char[30];
        int Lenth = reader.read(arr2);
        System.out.println(Lenth);
        for (int i = 0; i < Lenth; i++) {
            System.out.printf("%c",arr2[i]);
        }

    }
}
